import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'

import '@/assets/styles/index.scss' // global css

import App from './App'
import store from './store'
import router from './router'
import {
	postRequest,
	putRequest,
	postParamsRequest,
	getRequest,
	deleteRequest
} from "./api";
import { resetForm, addDateRange } from "@/utils/salary"
import { parseTime } from './utils'
import plugins from './plugins' // plugins

import '@/assets/icons' // icon
import '@/permission' // permission control

// 自定义组件
import RightToolbar from "@/components/RightToolbar"
import Pagination from "@/components/Pagination"

Vue.use(ElementUI, { size: 'medium' })
Vue.use(plugins)

Vue.config.productionTip = false

// 插件形式使用axios请求
Vue.prototype.postRequest = postRequest
Vue.prototype.postParamsRequest = postParamsRequest
Vue.prototype.putRequest = putRequest
Vue.prototype.deleteRequest = deleteRequest
Vue.prototype.getRequest = getRequest

// 定义全局方法
Vue.prototype.resetForm = resetForm
Vue.prototype.parseTime = parseTime
Vue.prototype.addDateRange = addDateRange

// 全局组件挂载
Vue.component('RightToolbar', RightToolbar)
Vue.component('Pagination', Pagination)

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
